#pragma warning disable 108
using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using Cephei;
using Cephei.Core;
using Cephei.Core.Generic;
using Microsoft.FSharp.Core;
using Cephei.QL.Models.Equity;
using Cephei.QL.Instruments;
namespace Cephei.QL.Pricingengines.Vanilla
{
    /// <summary> 
	/// ! this classes price european options under the following processes  1. Jump-Diffusion with Stochastic Volatility  \f[ \begin{array}{rcl} dS(t, S)  &=& (r-d-\lambda m) S dt +\sqrt{v} S dW_1 + (e^J - 1) S dN \\ dv(t, S)  &=& \kappa (\theta - v) dt + \sigma \sqrt{v} dW_2 \\ dW_1 dW_2 &=& \rho dt \end{array} \f]  N is a Poisson process with the intensity \f$ \lambda \f$. When a jump occurs the magnitude J has the probability density function \f$ \omega(J) \f$.  1.1 Log-Normal Jump Diffusion: BatesEngine  Logarithm of the jump size J is normally distributed \f[ \omega(J) = \frac{1}{\sqrt{2\pi \delta^2}} \exp\left[-\frac{(J-\nu)^2}{2\delta^2}\right] \f]  1.2  Double-Exponential Jump Diffusion: BatesDoubleExpEngine  The jump size has an asymmetric double exponential distribution \f[ \begin{array}{rcl} \omega(J)&=&  p\frac{1}{\eta_u}e^{-\frac{1}{\eta_u}J} 1_{J>0} + q\frac{1}{\eta_d}e^{\frac{1}{\eta_d}J} 1_{J<0} \\ p + q &=& 1 \end{array} \f]  2. Stochastic Volatility with Jump Diffusion and Deterministic Jump Intensity  \f[ \begin{array}{rcl} dS(t, S)  &=& (r-d-\lambda m) S dt +\sqrt{v} S dW_1 + (e^J - 1) S dN \\ dv(t, S)  &=& \kappa (\theta - v) dt + \sigma \sqrt{v} dW_2 \\ d\lambda(t) &=& \kappa_\lambda(\theta_\lambda-\lambda) dt \\ dW_1 dW_2 &=& \rho dt \end{array} \f]  2.1 Log-Normal Jump Diffusion with Deterministic Jump Intensity BatesDetJumpEngine  2.2 Double-Exponential Jump Diffusion with Deterministic Jump Intensity BatesDoubleExpDetJumpEngine   References:  D. Bates, Jumps and stochastic volatility: exchange rate processes implicit in Deutsche mark options, Review of Financial Sudies 9, 69-107.  A. Sepp, Pricing European-Style Options under Jump Diffusion Processes with Stochastic Volatility: Applications of Fourier Transform (<http://math.ut.ee/~spartak/papers/stochjumpvols.pdf>)  \ingroup vanillaengines  \test the correctness of the returned value is tested by reproducing results available in web/literature, testing against QuantLib's jump diffusion engine and comparison with Black pricing.
	/// </summary>
    [Guid ("10FF4C90-D989-43ff-B54F-284E914DDF7B"),ComVisible(true)]
	public interface IBatesEngine : Cephei.QL.Pricingengines.Vanilla.IAnalyticHestonEngine
	{
		///////////////////////////////////////////////////////////////
        // Methods
        //
    }   

    /// <summary> 
	/// ! this classes price european options under the following processes  1. Jump-Diffusion with Stochastic Volatility  \f[ \begin{array}{rcl} dS(t, S)  &=& (r-d-\lambda m) S dt +\sqrt{v} S dW_1 + (e^J - 1) S dN \\ dv(t, S)  &=& \kappa (\theta - v) dt + \sigma \sqrt{v} dW_2 \\ dW_1 dW_2 &=& \rho dt \end{array} \f]  N is a Poisson process with the intensity \f$ \lambda \f$. When a jump occurs the magnitude J has the probability density function \f$ \omega(J) \f$.  1.1 Log-Normal Jump Diffusion: BatesEngine  Logarithm of the jump size J is normally distributed \f[ \omega(J) = \frac{1}{\sqrt{2\pi \delta^2}} \exp\left[-\frac{(J-\nu)^2}{2\delta^2}\right] \f]  1.2  Double-Exponential Jump Diffusion: BatesDoubleExpEngine  The jump size has an asymmetric double exponential distribution \f[ \begin{array}{rcl} \omega(J)&=&  p\frac{1}{\eta_u}e^{-\frac{1}{\eta_u}J} 1_{J>0} + q\frac{1}{\eta_d}e^{\frac{1}{\eta_d}J} 1_{J<0} \\ p + q &=& 1 \end{array} \f]  2. Stochastic Volatility with Jump Diffusion and Deterministic Jump Intensity  \f[ \begin{array}{rcl} dS(t, S)  &=& (r-d-\lambda m) S dt +\sqrt{v} S dW_1 + (e^J - 1) S dN \\ dv(t, S)  &=& \kappa (\theta - v) dt + \sigma \sqrt{v} dW_2 \\ d\lambda(t) &=& \kappa_\lambda(\theta_\lambda-\lambda) dt \\ dW_1 dW_2 &=& \rho dt \end{array} \f]  2.1 Log-Normal Jump Diffusion with Deterministic Jump Intensity BatesDetJumpEngine  2.2 Double-Exponential Jump Diffusion with Deterministic Jump Intensity BatesDoubleExpDetJumpEngine   References:  D. Bates, Jumps and stochastic volatility: exchange rate processes implicit in Deutsche mark options, Review of Financial Sudies 9, 69-107.  A. Sepp, Pricing European-Style Options under Jump Diffusion Processes with Stochastic Volatility: Applications of Fourier Transform (<http://math.ut.ee/~spartak/papers/stochjumpvols.pdf>)  \ingroup vanillaengines  \test the correctness of the returned value is tested by reproducing results available in web/literature, testing against QuantLib's jump diffusion engine and comparison with Black pricing. Factory
	/// </summary>
   	[ComVisible(true)]
    public interface IBatesEngine_Factory 
    {
        ///////////////////////////////////////////////////////////////
        // Factory methods
        //
        /// <summary> 
		/// 
		/// </summary>
	    IBatesEngine Create (Cephei.QL.Models.Equity.IBatesModel model, Double relTolerance, UInt64 maxEvaluations);
        /// <summary> 
		/// 
		/// </summary>
	    IBatesEngine Create (Cephei.QL.Models.Equity.IBatesModel model, Microsoft.FSharp.Core.FSharpOption<UInt64> integrationOrder);
    }
}

